package bbs.service;

import bbs.exception.ServiceException;
import bbs.mapper.BoardMapper;
import bbs.model.Board;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author ljg;
 * @create 2022-06-08 10:27
 */
@Service
@Transactional(rollbackFor = {RuntimeException.class, ServiceException.class})
public class BoardService {
    @Autowired
    private BoardMapper boardMapper ;

    /**
     * 获取所有 板块
     * @return
     */
    public List<Board> loadAllBoard() {
        return boardMapper.loadAllBoard();

    }

    public Board findById( Integer id ){
        return boardMapper.findById( id ) ;
    }
}
